﻿<Window x:Class="ejpClient.ejpWindows.EjsOpenAssignmentWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ejs="clr-namespace:ejpClient.ejpWindows"
    Title="アサインメントを選択して下さい"
    ResizeMode="NoResize" WindowStyle="ToolWindow" WindowStartupLocation="CenterOwner"
	Width="650" Height="600">
    <Window.Background>
        <ImageBrush Stretch="None" TileMode="Tile" Viewport="0,0,20,20" ViewportUnits="Absolute" 
                           ImageSource="pack://application:,,,/imgData/bgtile.png" />
    </Window.Background>
    <Window.Resources>
        <ejs:ObservableCourseList x:Key="CourseList"/>
        <ejs:ObservableAssignmentList x:Key="AssignmentList"/>
        <ejs:CourseSqlDateConverter x:Key="SqlDateConverter"/>
        <ejs:StudyListToStudyCount x:Key="StudyCountConverter"/>
    </Window.Resources>
    <Grid x:Name="LayoutRoot" Margin="15,15,15,15">
        <Rectangle Stroke="{x:Null}" Margin="0,0,0,0" RadiusX="15.5" RadiusY="15.5">
            <Rectangle.Fill>
                <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                    <GradientStop Color="#FF7FB2F0" Offset="0"/>
                    <GradientStop Color="#FFFAFAFA" Offset="1"/>
                </LinearGradientBrush>
            </Rectangle.Fill>
        </Rectangle>
        <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" 
                   Fill="#FFFFFFFF" Stroke="#FF7FB2F0" Margin="10,16,10,16" RadiusX="13.5" RadiusY="13.5"/>
        
        <Canvas DataContext="{Binding Path=SelectedValue, ElementName=_lv_Assignments, Mode=Default}">
            <TextBlock Width="Auto" Height="13" TextWrapping="Wrap" Text="ログイン：" Canvas.Left="345" Canvas.Top="29" FontSize="10"/>
            <TextBlock Width="Auto" Height="13" TextWrapping="Wrap" Text="" x:Name="_tb_LoginName" Canvas.Left="399" Canvas.Top="29" FontSize="10"/>
            <TextBlock Width="48" Height="16" Canvas.Left="347" Canvas.Top="54" Text="コース：" TextWrapping="Wrap"/>
            <ComboBox x:Name="_cb_Courses" Width="166.313" Height="22" Canvas.Left="399" Canvas.Top="54" IsSynchronizedWithCurrentItem="True"
                      ItemsSource="{Binding Mode=OneWay, Source={StaticResource CourseList}}" DisplayMemberPath="_name"
                      SelectionChanged="OnCourseListSelectionChanged"/>
            <ListView IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding Mode=OneWay, Source={StaticResource AssignmentList}}"
                      x:Name="_lv_Assignments" Width="545.878" Height="178" Canvas.Left="21.435" Canvas.Top="89">
                <ListView.View>
                    <GridView>
                        <GridViewColumn DisplayMemberBinding="{Binding Path=Title}" Header="課題名"/>
                        <GridViewColumn DisplayMemberBinding="{Binding Path=studies, Converter={StaticResource StudyCountConverter}}" Header="Study数"/>
                        <GridViewColumn DisplayMemberBinding="{Binding Path=OwnerName}" Header="作成者"/>
                        <GridViewColumn DisplayMemberBinding="{Binding Path=LastModifiedDate, Converter={StaticResource SqlDateConverter}}" Header="公開日時"/>
                    </GridView>
                </ListView.View>
            </ListView>
            <ListView ItemsSource="{Binding Path=studies}" IsSynchronizedWithCurrentItem="True" Width="545.878" 
                      Height="200.06" Canvas.Left="21.435" Canvas.Top="271.51">
                <ListView.View>
                    <GridView>
                        <GridViewColumn DisplayMemberBinding="{Binding Path=Title}" Header="Study名"/>
                    </GridView>
                </ListView.View>
            </ListView>
            <Button Width="78.595" Height="24.293" Content="キャンセル" Canvas.Left="488.718" Canvas.Top="481.573" Click="OnCancel"/>
            <Button Width="78.595" Height="24.293" Content="開く" Canvas.Left="21.435" Canvas.Top="481.573" Click="OnOpenAssignment"/>
            <Button Width="78.595" Height="24.293" Content="削除" Canvas.Left="114.32" Canvas.Top="481.573" Click="OnDeleteAssignment"/>
        </Canvas>
    </Grid>
</Window>
